package com.jinmdz.fmis.mapper.mapper;

import org.apache.ibatis.annotations.*;
import com.jinmdz.fmis.mapper.mapper.provider.CremationFurnaceCameraProvider;
import com.jinmdz.fmis.mapper.entity.CremationFurnaceCameraEntity;

import java.util.ArrayList;

/**
 * 火化炉炕面摄像头信息表Mapper
 * 
 * @author generator
 * @date 2020-08-23 18:11
 */
public interface CremationFurnaceCameraMapper {

    /**
     * 增加CremationFurnaceCamera
     * 
     * @param entity 数据实体
     * @return
     * @author generator
     * @date 2020-08-23 18:11
     */
    @InsertProvider(type = CremationFurnaceCameraProvider.class, method = "insertCremationFurnaceCamera")
    @Options(useGeneratedKeys = true, keyProperty = "entity.id", keyColumn = "id")
    void insertCremationFurnaceCamera(@Param("entity") CremationFurnaceCameraEntity entity);

    /**
     * 删除CremationFurnaceCamera
     * 
     * @param id 主键
     * @param modifiedUserId 修改用户外键
     * @param version 版本号
     * @return
     * @author generator
     * @date 2020-08-23 18:11
     */
    @Update(" update cremation_furnace_camera set deleted = 1,modified_user_id = #{modifiedUserId},version = unix_timestamp(now()) where id = #{id} and version = #{version} and unmodified = 0 and deleted = 0 ")
    void deletedForCremationFurnaceCamera(@Param("id") Integer id, @Param("modifiedUserId") Integer modifiedUserId, @Param("version") Long version);

    /**
     * 修改CremationFurnaceCamera
     * 
     * @param entity 数据实体
     * @return
     * @author generator
     * @date 2020-08-23 18:11
     */
    @UpdateProvider(type = CremationFurnaceCameraProvider.class, method = "updateCremationFurnaceCamera")
    void updateCremationFurnaceCamera(@Param("entity") CremationFurnaceCameraEntity entity);

    /**
     * 查询CremationFurnaceCamera实体
     * 
     * @param id 主键
     * @return CremationFurnaceCameraEntity
     * @author generator
     * @date 2020-08-23 18:11
     */
    @Select(" select id,deleted,furnace_id,ip_address,port_number,account,password,funeral_parlour_code,create_user_id,gmt_create,unmodified,modified_user_id,gmt_modified,version from cremation_furnace_camera where id = #{id} and deleted = 0 limit 1 ")
    CremationFurnaceCameraEntity getCremationFurnaceCameraById(@Param("id") Integer id);

    /**
     * 查询CremationFurnaceCamera列表
     * 
     * @param entity 数据实体
     * @return CremationFurnaceCameraEntity
     * @author generator
     * @date 2020-08-23 18:11
     */
    @SelectProvider(type = CremationFurnaceCameraProvider.class, method = "listCremationFurnaceCamera")
    ArrayList<CremationFurnaceCameraEntity> listCremationFurnaceCamera(@Param("entity") CremationFurnaceCameraEntity entity);
}